using System.Windows.Forms;
using Nuwanda.TfsSpotlight.Shell.Expressions;
using StructureMap;
using StructureMap.Attributes;

namespace Nuwanda.TfsSpotlight.Shell.Services.Interfaces
{
    /// <summary>Provides menu management services</summary>
    [PluginFamily("ShellMenuService", Scope = InstanceScope.Singleton)]
    public interface IMenuService
    {
        /// <summary>Allows to register given <paramref name="command"/></summary>
        /// <param name="command">Command to register</param>
        /// <returns>Expression that allows fluent configuration</returns>
        ICommandConfigurationExpression RegisterCommand(string command);

        /// <summary>Allows to register an activator for a given <paramref name="command"/></summary>
        /// <param name="command">Command to register activator for</param>
        /// <returns>Expression that allows fluent configuration</returns>
        IActivatorConfigurationExpression RegisterCommandActivator(string command);

        /// <summary>Invalidates commands using activators associated with a given <paramref name="key"/></summary>
        /// <param name="key">Key to select acivators</param>
        void InvalidateCommands(object key);

        /// <summary>Runs given <paramref name="command"/></summary>
        /// <param name="command">Command to run</param>
        void RunCommand(string command);

        /// <summary>Invalidates all commands using all activators</summary>
        void InvalidateCommands();

        /// <summary>Disables commands with activators for a given <paramref name="key"/></summary>
        /// <param name="key">Key to select activators</param>
        void DisableCommands(object key);

        /// <summary>Retrieves command by a <paramref name="shortcut"/></summary>
        /// <param name="shortcut">Shortcut to select</param>
        /// <returns>Command</returns>
        string GetCommandNameByShortcut(Keys shortcut);

        /// <summary>Allows to configure the tool strip</summary>
        /// <returns>Expression that allows fluent configuration</returns>
        IToolStripConfigurationExpression ConfigureToolStrip();

        /// <summary>Allows to add custom elements to the tool strip</summary>
        /// <param name="command">Command to associate custom elements with</param>
        /// <returns>Expression that allows fluent configuration</returns>
        ICustomToolStripConfigurationExpression ConfigureCustomToolStrip(string command);

        IContextMenuConfiguretionExpression ConfigureContextMenu(string contextMenuName);
        ContextMenuStrip GetContextMenu(string contextMenuName);
    }
}